Skip to content

SED-4539 automation package collection and accessor#615

Open
cmisev wants to merge 20 commits intomasterfrom
SED-4539-automation-package-collection-and-accessor
Open

SED-4539 automation package collection and accessor#615
cmisev wants to merge 20 commits intomasterfrom
SED-4539-automation-package-collection-and-accessor

Conversation

@cmisev
Copy link

@cmisev cmisev commented Mar 19, 2026

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a robust framework for managing automation package YAML files programmatically, particularly focusing on plans. By providing collection-like access and precise YAML patching capabilities, it lays the groundwork for more sophisticated tooling, such as IDE integrations, that can manipulate automation package definitions while preserving their integrity and structure.

Highlights

  • New Module Introduction: A new Maven module, step-automation-packages-ide, has been introduced to house functionalities related to IDE integration for automation packages.
  • YAML Fragment Management: A new AutomationPackageYamlFragmentManager class has been implemented to centralize the management of YAML fragments within automation packages, enabling programmatic saving, modification, and removal of entities like plans while preserving YAML structure.
  • Collection-like Access for Plans: New AutomationPackageCollectionFactory and AutomationPackagePlanCollection classes provide a collection-like interface for interacting with plans defined in automation package YAML files, facilitating CRUD operations.
  • Enhanced YAML Deserialization for Patching: The YAML deserialization process has been significantly enhanced with PatchableYamlArtefact, PatchingParserDelegate, and PatchableYamlArtefactDeserializer to capture precise source location information, which is crucial for making targeted modifications to YAML content.
  • Refactoring of YAML Model and Reader: Core YAML model classes (AbstractAutomationPackageFragmentYaml, AutomationPackageDescriptorYamlImpl, AutomationPackageFragmentYaml) and the AutomationPackageDescriptorReader have been refactored to support the new fragment management and deserialization capabilities, including Jackson injection for dependencies and dynamic handling of additional fields.
  • Comprehensive Testing: Extensive unit tests have been added for the new collection and fragment management features, covering various scenarios such as reading, modifying, renaming, adding, and removing plans within YAML files.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new step-automation-packages-ide module, which provides a collection-based accessor for automation packages, particularly for plans stored in YAML. This is a significant feature that allows treating file-based plans as if they were in a database collection, with support for reading, creating, updating, and deleting. The implementation cleverly uses YAML patching to preserve formatting and comments, which is a great approach. The changes are extensive and well-tested.

My review has identified a few areas for improvement. The primary concern is the exception handling strategy in several new classes, where checked exceptions are wrapped in generic RuntimeException. This can obscure error details and should be addressed. I also found a bug in YamlPlainTextPlan where an incorrect collection name is returned. Additionally, there are a couple of minor code hygiene issues that I've pointed out.

Comment on lines +188 to +190
} catch (IOException e) {
throw new RuntimeException(e);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The method is declared to throw AutomationPackageReadingException, but IOException is wrapped in a generic RuntimeException. This violates the method's contract and hides the specific nature of the error. It's better to wrap it in the declared exception type, consistent with how other IOExceptions are handled in this project.

Suggested change
} catch (IOException e) {
throw new RuntimeException(e);
}
} catch (IOException e) {
throw new AutomationPackageReadingException("Failed to read automation package descriptor", e);
}

Comment on lines +68 to +71
@Override
public String getCollectionName() {
return "plainTextPlan";
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The collection name for plain text plans in the YAML files is plansPlainText. This method returns plainTextPlan, which is incorrect and will cause issues when trying to add or modify plain text plans in YAML fragments.

Suggested change
@Override
public String getCollectionName() {
return "plainTextPlan";
}
@Override
public String getCollectionName() {
return "plansPlainText";
}
References
  1. Ensure consistency in naming conventions. If a constant's string representation is renamed, its corresponding object constant should also be renamed to maintain clarity and consistency across the codebase.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should show as outdated, not sure why it does not...

@cmisev cmisev marked this pull request as draft March 19, 2026 09:57
@cmisev cmisev marked this pull request as ready for review March 20, 2026 10:55
@cmisev cmisev requested a review from cl-exense March 20, 2026 10:56
@cmisev cmisev changed the title Sed 4539 automation package collection and accessor SED-4539 automation package collection and accessor Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant